'''
Created on 2009-02-26

@author: belleyma
'''
from tkinter import *

class DataSender(Frame):
    '''
    classdocs
    '''
    def body(self):
        Label(self, text="First:").grid(row=0, sticky=W)
        Label(self, text="Second:").grid(row=1, sticky=W)
        
        self.e1 = Entry(self)
        self.e2 = Entry(self)
    
        self.e1.grid(row=0, column=1)
        self.e2.grid(row=1, column=1)
    
        self.__var = IntVar()
        self.cb = Checkbutton(self, text="Hardcopy", variable=self.__var)
        self.cb.grid(row=2, columnspan=2, sticky=W)
        self.cb["command"] = self.CbAction

    def CbAction(self):
        if (self.__var.get()):
            self.cb["text"] = "ON"
        elif(not self.__var.get()):
            self.cb["text"] = "OFF"

    def __init__(self, master=None):
        '''
        Constructor
        '''
        Frame.__init__(self, master)
        self.pack()
        self.body()
  
root = Tk()
app = DataSender(master=root)
app.mainloop()
root.destroy()
